package ar.edu.uba.fi.jmit.aspecter.itegration.testUtils;

import java.util.Map;

import ar.edu.uba.fi.jmit.aspecter.AspecterMain;
import ar.edu.uba.fi.jmit.aspecter.core.AdviceWeaver;
import ar.edu.uba.fi.jmit.aspecter.testUtils.DebugAdviceWeaver;

public class AspecterMainDebug extends AspecterMain {
	
	private static DebugAdviceWeaver instance;

	public AspecterMainDebug(String jmitXmlPath, String rootPackagePath,
			String classDestDirectory, String enviroment) {
		super("test", jmitXmlPath, rootPackagePath, classDestDirectory, enviroment);
	}

	protected AdviceWeaver createAdviceWeaver(String destDirectory) {
		if(instance == null) {
			instance = new DebugAdviceWeaver(destDirectory, "target/test-backups");
		}
		return instance;
	}
	
	public static void restore() {
		if(instance != null) {
			instance.restore();
			instance = null;
		}
	}
	
	@Override
	protected void configureSender(Map<String, String> monitorEngineProps) {
	}
}
